Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIRA-002 Implemented Book reordering #2

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

AnjaBasara
Copy link
Owner

What?

Added logic for reordering books on the index page, as well as logic for reordering edited book after the stock_amount has been changed. For more background, see ticket #JIRA-002.

Why?

These changes complete the user book management experience, ensuring that the books are displayed in the desired order.

How?

This includes a migration, updated factory and seeder, form request classes, updated controller, new repository and a service for book management. Used form request classes to move validation out of controllers and moved business logic to a service.

Testing?

Testing reordering books:

  1. Open index page
  2. Choose a book with a positive stock amount
  3. Move the book up or down by entering a number in the appropriate field
  4. Click Move button
  5. The book is appropriately reordered

Testing changing book stock amount:

  1. Open index page
  2. Choose a book and click Edit button
  3. Change stock amount (if positive, set it to zero, or if zero set it to a positive number)
  4. Click Update button
  5. The book is appropriately reordered

Screenshots?

screenshot_1
screenshot_2

Anything else?

It would be good to consider having one set of Up, Down and Move (with book selection) since this way the user can enter multiple "ups" and "downs" but the Move button is tied to one book, so one set of those fields feels more intuitive.

@AnjaBasara AnjaBasara added the enhancement New feature or request label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants